Conversation
* handling the new alert when creating a new version of an item that is in moderation * refactoring code to reduce duplicated code
SammyIsConfused
left a comment
There was a problem hiding this comment.
Looks good! Just a few minor changes. 👍
| itemList = adminPage.results(); | ||
| // Login as SimpleModerator and moderate the new version of this item at the first step. | ||
| logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD); | ||
| doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, "moderation step 1", itemFullName2,false); |
There was a problem hiding this comment.
Maybe create a constant for "moderation step 1" string, as it is used more than once. Probably step 2 as well, for consistency.
| @TestInstitution("workflow") | ||
| public class NewVersionTest extends AbstractCleanupTest | ||
| { | ||
| private static final String BACKTICK_PASSWORD = "``````"; |
There was a problem hiding this comment.
Since these are all public static final String, the whitespaces between each line should be removed.
| String itemFullName2 = itemFullName + " 2"; | ||
| wizard.editbox(1, itemFullName); | ||
| wizard.save().submit(); | ||
| saveItem(wizard,1,itemFullName); |
There was a problem hiding this comment.
There should be space between the parameters.
edalex-ian
left a comment
There was a problem hiding this comment.
Couple of tweaks, then we should be done. 👍
| } | ||
|
|
||
| private void doModeration(String username, String password, String stepName, String itemFullName, Boolean lastModeration) { | ||
| TaskListPage taskListPage = new TaskListPage(context).load(); |
There was a problem hiding this comment.
username and password are unused. Remove.
| // Login as SimpleModerator and moderate the new version of this item at the first step. | ||
| logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD); | ||
| doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, STEP_NAME_ONE, itemFullName2,false); | ||
| // After moderation, check that the item has gone life after the first moderation step |
There was a problem hiding this comment.
typo:
has gone
life
should be
has gone live
| ModerationView tasksTab = modResults.moderate(itemFullName); | ||
| tasksTab.assignToMe(); | ||
| tasksTab.accept(); | ||
| } |
There was a problem hiding this comment.
For this if/else the braces should follow the statement.
Shame we don't have formatting here yet, but we will once we merge this repo in.
ce8d91b to
e7d534d
Compare
handling the new alert when creating a new version of an
item that is in moderation
refactoring code to reduce duplicated code